import {NgModule} from '@angular/core';
import {NZ_ICONS, NzIconModule} from 'ng-zorro-antd/icon';
import {registerLocaleData} from "@angular/common";
import zh from '@angular/common/locales/zh'

import {
  AccountBookFill,
  AlertFill,
  AlertOutline,
  DashboardOutline,
  FormOutline,
  MenuFoldOutline,
  MenuUnfoldOutline,
  UserAddOutline,
  UsergroupAddOutline,
  UserOutline,
  UserSwitchOutline
} from '@ant-design/icons-angular/icons';

const icons = [MenuFoldOutline, MenuUnfoldOutline, DashboardOutline,
  FormOutline,AccountBookFill, AlertFill, AlertOutline, UserAddOutline, UserOutline,UsergroupAddOutline,UserSwitchOutline];

registerLocaleData(zh);  // en

//import * as AllIcons from '@ant-design/icons-angular/icons'
//import {IconDefinition} from "@ant-design/icons-angular";
// const antDesignIcons = AllIcons as {
//   [key: string]: IconDefinition;
// };  //例: nz-icon [nzType]="'user-add'"
// const icons: IconDefinition[] = Object.keys(antDesignIcons).map(key => antDesignIcons[key])

@NgModule({
  imports: [NzIconModule.forRoot(icons)],
  exports: [NzIconModule],
  providers: [
    { provide: NZ_ICONS, useValue: icons }
  ]
})
export class IconsProviderModule {
}
